<html ng-app>   
 <head>
 <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<script src="/js/angular.js" type="text/javascript" ></script>   
      </head>    
 <body>
 
        <div ng-controller="myctl">          
     <b>玩加法:</b>             
              <table>
                <tr><td>第一个数</td><td>第二个数</td></tr>                <tr>
                    <td>
   <input type="integer" min="0" ng-model="firstnum" required/></td>                 
      <td><input type="number" ng-model="secondnum" required/></td>      
             </tr>         
      </table>            
   <hr/>
            <b>值是:</b>{{firstnum + secondnum}}
<hr/>

  </div>   

<script>
function myctl($scope) //这个函数等于是构造函数，做一些初始化
 {  
  $scope.firstnum=0;
   $scope.secondnum=1;
}

</script>
 </body>
 
</html>

